package net.wy.commons.web.jacson;

import org.codehaus.jackson.map.ObjectMapper;
import org.codehaus.jackson.map.SerializationConfig;

/**
 * Created with IntelliJ IDEA.
 * User: Administrator
 * Date: 12-8-30
 * Time: 上午11:35
 * To change this template use File | Settings | File Templates.
 */
public class SimpleAwareObjectMapper extends ObjectMapper {

    public SimpleAwareObjectMapper() {
        setSerializerFactory(new SimpleAwareSerializerFactory(new SimpleSerializerFactoryConfig()));
        configure(SerializationConfig.Feature.FAIL_ON_EMPTY_BEANS, false);
    }

    public void setPrettyPrint(boolean prettyPrint) {
        configure(SerializationConfig.Feature.INDENT_OUTPUT, prettyPrint);
    }
}
